<template>
  <div class="goods-list container">
    <ul>
      <li v-for="it in list" :key="it.id">
        <RouterLink class="goods-item" to="/">
          <img :src="it.picture" alt="" />
          <p class="name ellipsis">{{ it.name }}</p>
          <p class="desc ellipsis">{{ it.desc }}</p>
          <p class="price">&yen;{{ it.price }}</p>
        </RouterLink>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'GoodsList',
  props: {
    list: Array
  },
  setup () {}
}
</script>

<style lang="less" scoped>
.goods-list {
  background: #fff;
  padding: 0 25px;
  ul {
    display: flex;
    flex-wrap: wrap;
    padding: 0 5px;

    li {
      margin-right: 20px;
      margin-bottom: 20px;
    }
    li:nth-child(5n) {
      margin-right: 0;
    }
  }
  .goods-item {
    display: block;
    width: 220px;
    // padding: 20px 30px;

    text-align: center;
    .hoverShadow();
    img {
      width: 160px;
      height: 160px;
    }
    p {
      padding-top: 10px;
    }
    .name {
      font-size: 16px;
    }
    .desc {
      color: #999;
      height: 29px;
    }
    .price {
      color: @priceColor;
      font-size: 20px;
    }
  }
}
</style>
